package domain;

import aima.core.agent.Action;
import aima.core.search.framework.ResultFunction;

public class PacmanResultFunction implements ResultFunction {

	@Override
	public Object result(Object s, Action a) {
		if(a instanceof PacmanAction) {
			PacmanAction action = (PacmanAction) a;	
			PacmanBoard board = (PacmanBoard) s;
			PacmanBoard newBoard = new PacmanBoard(board.getMap(), board.getCrumbs(), action.getLocation());
			s = newBoard;			
		}
		return s;
	}

}
